<?php
// +----------------------------------------------------------------------
// | 选座 模型
// +----------------------------------------------------------------------
namespace app\wechat\model;

use think\Model;
use think\Db;

class Violation extends Model{
    // 定义时间戳字段名
    protected $createTime = 'ctime';
    protected $updateTime = '';
    protected $autoWriteTimestamp = true;
    /**
     * 添加数据
     * @param array $data 修改、添加数据
     * @return bool
     */
    public function updateAllData($data){
        $res = $this->saveAll($data);
        return $res ? true:false;
    }
    public function getGroupCount($num){
        $res = $this->where('status',0)->group('userid')->having('count(id)>'.$num)->field('userid')->select();
        return $res ? $res : false;
    }
}